package com.hnkywl.jip.service;

import com.hnkywl.jip.dao.BankDao;
import com.hnkywl.jip.utils.BankData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: jerry
 * Date: 13-3-1
 * Time: 下午6:34
 * To change this template use File | Settings | File Templates.
 */
@Service
public class BankService {
    private BankDao bankDao;

    @Transactional
    public List searchBankMapping(Integer companyId){
        return bankDao.searchBankMapping(companyId);
    }

    @Transactional
    public void saveBankMapping(List<BankData> bankDataList){
        for(BankData bankData:bankDataList)
            this.bankDao.saveBankMapping(bankData);
    }

    @Autowired
    public void setBankDao(BankDao bankDao) {
        this.bankDao = bankDao;
    }
}
